<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
	<head>
		<title>
			<s:text name="label.student_subjects.h1"/>
			<s:property value="alu.nombre"/>			
			(<s:property value="alu.dni"/>)
		</title>
		<link href="<s:url value='/css/main.css'/>" rel="stylesheet" type="text/css"/>
	</head>
	<body>
		<div class="titleDiv">
			<s:text name="label.title_body"/>
		</div>
		
		<h1>
			<s:text name="label.student_subjects.h1"/>
			<s:property value="alu.nombre"/>			
			(<s:property value="alu.dni"/>)
		</h1>
		<br/>
		
		<table>
			<tr>
				<td>
					<s:url id="url_enroll" action="subject_enroll" escapeAmp="false"/>
					<a href="<s:property value='#url_enroll'/>">
						<s:text name="label.enroll_in_a_subject"/>
					</a>
				</td>
				<td>
					<s:url id="url_list_marks" action="subject" escapeAmp="false"/>
					<a href="<s:property value='#url_list_marks'/>">
						<s:text name="label.display_marks"/>
					</a>
				</td>
				<td>
					<s:url id="logoutLink" action="student!logout" />
					<s:a href="%{logoutLink}"><s:text name="label.lecturerSubjects.logout"/></s:a>				
				</td>
			</tr>
		</table>
		
		<br/>
		<table class="borderAll">
		    <tr>
		        <th>
					<s:text name="label.subject.code"/>
				</th>
		        <th>
					<s:text name="label.subject.name"/>
				</th>
		        <th>
					<s:text name="label.subject.credits"/>
				</th>
		        <th>
					<s:text name="label.subject.lecturer"/>
				</th>
		        <th>
					<s:text name="label.subject.units"/>
				</th>
		        <th>
					<s:text name="label.subject.student_number"/>
				</th>
		    </tr>
			
		    <s:iterator value="asigs" status="status">					
		        <tr class="<s:if test="#status.even">even</s:if><s:else>odd</s:else>">
		            <td class="nowrap"><s:property value="codigo"/></td>
		            <td class="nowrap"><s:property value="nombre"/></td>
		            <td class="nowrap"><s:property value="creditos"/></td>
		            <td class="nowrap"><s:property value="profesor.nombre"/></td>
		            <td>
						<s:url id="unitList" action="doSubject!ShowSubjectUnits" escapeAmp="false">
							<s:param name="asigID" value="id"/>							
						</s:url>
						<a href="<s:property value="%{unitList}"/>">
							<s:property value="unidades.size"/>
						</a>						
					</td>
		            <td class="nowrap"><s:property value="alumnos.size"/></td>
					<td>
						<s:url id="disenroll" action="disenroll" escapeAmp="false">
							<s:param name="subjectId" value="id"/>							
						</s:url>
						<a href="<s:property value="#disenroll"/>">
							<s:text name="label.student_subjects.disenroll"/>
						</a>
					</td>
		            <td>
						<s:url id="url_subject_list_marks" action="subjectOne" escapeAmp="false">
							<s:param name="subjectId" value="id"/>
						</s:url>
						<a href="<s:property value="#url_subject_list_marks"/>">
							<s:text name="label.student_subjects.notes"/>
						</a>
					</td>
		        </tr>				
		    </s:iterator>	
		</table>	
	</body>
</html>

